package LeetCode;

public class LC_344_ReverseString {

    public static void main(String[] args) {

    }

    static class Solution {
        public String reverseString(String s) {
            char[] chars = new char[s.length()];
            int index = 0;
            for (int i = s.length() - 1; i >= 0; i--) {
                chars[index++] = s.charAt(i);
            }
            return new String(chars);
        }
    }

    static class Solution_2 {
        public String reverseString(String s) {
            return new StringBuilder(s).reverse().toString();
        }
    }

}